import BaseEndpoint from '../../Base/endpoint'
import GetEntityNode from './GetEntityNode'
import { v4 as uuidv4 } from 'uuid'

class GetDoubleNode extends GetEntityNode {
  [x: string]: any
  constructor(opts) {
    opts.width = 250
    opts.height = 220
    opts.nodeType = 'ENTITY_GET_DOUBLE'
    opts.text = '获取数据转换成浮点数'
    //设置连接点
    opts.endpoints = opts.endpoints || [
      {
        id: uuidv4(),
        type: 'target',
        scope: 'run',
        dataKey: 'from',
        pointType: 'start',
        limitNum: 1,
        orientation: [-1, 0],
        pos: [0, 0.33],
        Class: BaseEndpoint
      },
      {
        id: uuidv4(),
        type: 'source',
        scope: 'run',
        dataKey: 'to',
        pointType: 'end',
        limitNum: 1,
        orientation: [1, 0],
        pos: [0, 0.33],
        Class: BaseEndpoint
      },
      {
        id: uuidv4(),
        type: 'target',
        scope: 'entity',
        dataKey: 'params',
        pointType: 'input',
        orientation: [-1, 0],
        pos: [0, 0.58],
        title: '输入值（实体）',
        Class: BaseEndpoint
      },
      {
        id: uuidv4(),
        type: 'target',
        scope: 'string',
        dataKey: 'paramKey',
        pointType: 'input',
        orientation: [-1, 0],
        pos: [0, 0.69],
        title: '属性名称（字符串）',
        Class: BaseEndpoint
      },
      {
        id: uuidv4(),
        type: 'source',
        scope: 'double',
        pointType: 'output',
        dataKey: 'data',
        orientation: [1, 0],
        pos: [1, 0.62],
        title: '输出值（浮点数）',
        Class: BaseEndpoint
      }
    ]
    super(opts)
  }
}
export default GetDoubleNode
